home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / tplenses.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  2KB  |  75 lines

  1. /* Weird effect of multi-lenses in front of image */
  2. /* By Arnie Cachelin © 1994 NewTek Inc.           */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField            /* These are always passed to clip processing scripts */
  5.  
  6. address 'DigiPaint' /* Tell ARexx where commands go */
  7. screen=0
  8. if inclipname="" & outclipname="" then screen=1
  9. if screen=1 then do
  10.    startfield=1
  11.    endfield=1
  12.    outclipname="Test"
  13.    end
  14.  
  15. if screen=0 then do
  16.    'Askb'"This only works;with process screen."
  17.    exit
  18.    end
  19.  
  20. 'Drre'
  21. 'Flon'
  22. 'Hvof'                                  /* Turn off Horizontal and Vertical gradients */
  23. 'Hvar'                                  /* Toggle Horiz and Vert. Gradient (on) */
  24. 'Txva' $0000
  25. 'Tyva' $0000
  26. 'Dotb'
  27. 'Poth' $F000            /* Set Gradient center to middle ($0000 - $FFFF) */
  28. 'Rang'
  29. siz=120
  30. do y=0 to 480-1 by siz
  31.   do x=0 to 752-1 by siz
  32.     Call CutBrush(x,y,x+siz,y+siz)
  33.                 'Bcop'
  34.                 'Cbx0'
  35.                 'Pmcl'
  36.     Call Rectangle(x,y,x+siz,y+siz)
  37.                 'Txma'
  38.     Call DrawCircle(x,y,x+siz,y+siz)
  39.   end
  40. end
  41. exit
  42.  
  43. Rectangle: PROCEDURE
  44.   arg x,y,x2,y2
  45.   'Drre'
  46.   'Dotb'
  47.   'Pend' x y
  48.   'Penu' x2 y2
  49.   return 0
  50.  
  51. CutBrush: PROCEDURE  /* Cut out a brush with corners at (x1,y1) and (x2,y2) */
  52.   arg x1, y1, x2, y2
  53.   'Dotb'        /* smallest brush size */
  54.   'Drre'        /* Rectangle mode  */
  55.   'Scis'        /* Scissors on, for cutting a brush  */
  56.   'Pend' x1 y1  /* Get in top Left corner  */
  57.   'Penu' x2 y2  /* lift pen to get brush!  */
  58.   return 0
  59.  
  60. DrawCircle: PROCEDURE  /* Draw circle in box */
  61.   arg x1, y1, x2, y2
  62.   'Dotb'        /* smallest brush size */
  63.   'Drci'        /* Circle mode  */
  64.   'Pend' (x2+x1)%2 (y2+y1)%2  /* Get in Center  */
  65.   'Penu' x1 (y2+y1)%2  /* lift pen at edge  */
  66.   return 0
  67.  
  68. Lens: PROCEDURE
  69.   arg x1, y1, x2, y2
  70.   Call CutBrush(x1,y1,x2,y2)
  71.         'Bcop'
  72.         'Txma'
  73.   Call DrawCircle(x1,y1,x2,y2)
  74.   return 0
  75.